<include file="Public:header" />
<div id="zoneHeader">
    <h2>清除过期统计数据</h2>
</div><!--/#zoneHeader-->
<style type="text/css">
.schemaList {overflow:auto;}
.schemaList li{float:left;min-width:100px;margin-right:10px;}
</style>
<div id="zoneBody" class="noFooter">
    <div id="zoneBodyContent">
        <p>注：为防止误操作，以下显示的7天之前的数据模式</p>
        <ul class="schemaList">
            <volist name="record" id="vo">
            <li><label><input type="checkbox" name="d[]" value="{$vo.name}" /><span>{$vo.name}</span></label></li>
            </volist>
        </ul>
        <ul class="btnList">
            <li><button type="button" id="btnCleanStatsHistory" class="btn">清除</button></li>
        </ul>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<script type="text/javascript">
$(function(){
    $('#btnCleanStatsHistory').click(function(){
        var url = '?m=CostServer&a=doCleanStatsHistory',
            $d = $('.schemaList :checkbox[name="d[]"]:checked');

        if($d.length < 1) {
            alert('请选择需要清理的数据模式');
            return false;
        }

        var r = [];

        $d.each(function(k, v){
            r.push($(v).val());
        })

        var msg = '确认需要删除以下数据模式？' + "\n" + r.join("\n");

        if(!confirm(msg)) {
            return false;
        }

        var progress = $.messager.progress;
        progress({text : '正在删除，删除过程可能比较慢，请稍等...'});

        $.post(url, {d : r}, function(j){
                progress('close');
                alert(j.m);
                reload();
        }, 'json');
    })
})
</script>
<include file="Public:footer" />
